#include "ShaderCollection.h"


ShaderCollection::ShaderCollection(){
	subShades = new vector<SurfaceShader*>();
}


ShaderCollection::~ShaderCollection(){
}


vector<SurfaceShader*>::iterator ShaderCollection::subShaders(){
	return subShades->begin();
}

//get the surface color for this point
vec4 ShaderCollection::getColor(Intersection &_int){
	vec4 retColor = vec4(0,0,0,0);
	//loop through the sub shaders and add their color to retColor
	int count = this->count();
	for(int i = 0; i < count; i++){
		retColor += subShades->at(i)->getColor(_int, theScene);
	}
	return retColor;
}

void ShaderCollection::addShader(SurfaceShader *_shade){
	subShades->push_back(_shade);
}
